﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Modelo_ETdA.Interface
{
    public partial class chart : Form
    {
        public chart(List<int> x, List<int> y)
        {

            InitializeComponent();


            int i = 0;
            while (i < x.Count)
            {
                chart1.Series["Series1"].Points.AddXY(x[i], y[i]);
                i++;
            }

            chart1.Series["Series1"].Points[0].AxisLabel = "]0,15]";
            chart1.Series["Series1"].Points[1].AxisLabel = "]15,20]";
            chart1.Series["Series1"].Points[2].AxisLabel = "]20,25]";
            chart1.Series["Series1"].Points[3].AxisLabel = "]25,30]";
            chart1.Series["Series1"].Points[4].AxisLabel = "]30,35]";
            chart1.Series["Series1"].Points[5].AxisLabel = "]35,40]";
            chart1.Series["Series1"].Points[6].AxisLabel = "]40,45]";
            chart1.Series["Series1"].Points[7].AxisLabel = "]45,50]";
            chart1.Series["Series1"].Points[8].AxisLabel = "]50,55]";
            chart1.Series["Series1"].Points[9].AxisLabel = "]55,60]";
            chart1.Series["Series1"].Points[10].AxisLabel = "]60,70]";
            chart1.Series["Series1"].Points[11].AxisLabel = "]70,80]";
            chart1.Series["Series1"].Points[12].AxisLabel = ">80";

            chart1.ChartAreas["ChartArea1"].AxisY.Name = "Quantidade";
            chart1.ChartAreas["ChartArea1"].AxisX.Name = "Idade";

            try
            {
                chart1.SaveImage("dat.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
            }
            catch (Exception e)
            {
            }
            this.Close();

        }

    }
}
